/**
 * Created by weihuajiang on 2017/7/6.
 */
public class Test {

    public static void main(String[] args) {
        try {
            System.out.println(new IdWorker(0L,2L).nextId());
            System.out.println(new IdWorker(0L,2L).nextId());
            System.out.println(new IdWorker(0L,2L).nextId());

            System.out.println(new SnowflakeIdWorker(0L, 2L).nextId());
            Thread.sleep(1L);
            System.out.println(new SnowflakeIdWorker(0L, 2L).nextId());
            Thread.sleep(1L);
            System.out.println(new SnowflakeIdWorker(0L, 2L).nextId());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
